﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Controller;
using Interface;

namespace GUI
{
    /// <summary>
    /// Interaction logic for Kategorier.xaml
    /// </summary>
    public partial class KategoriVindue : Window
    {
        MainController controller;
        IKonkurrence aktuelKonkurrence;
        IKategori aktuelKategori;

        public KategoriVindue(MainController controller, IKonkurrence aktuelKonkurrence)
        {
            InitializeComponent();
            this.aktuelKonkurrence = aktuelKonkurrence;
            this.controller = controller;
        }
        
        private void btn_OpretKategori_Click(object sender, RoutedEventArgs e)
        {
            OpretKategoriVindue myOpretKategori = new OpretKategoriVindue(controller, aktuelKonkurrence);
            myOpretKategori.ShowDialog();

            this.Close();
        }

        public void test(string test, int test2)
        {

        }

        private void btn_SletKategori_Click(object sender, RoutedEventArgs e)
        {
            controller.FjernKategori(aktuelKategori);
        }

        private void lV_kategorier_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            aktuelKategori = (IKategori)lV_kategorier.SelectedItem;
        }

        private void btn_Tilbage_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
